#ifndef PICMOVE_H
#define PICMOVE_H

#include <QStringList>
#include <QStack>
#include <QtGui/QMainWindow>

#define MAX_DEST_COUNT 16

const Qt::Key ShortcutKeys[MAX_DEST_COUNT] = {Qt::Key_1, Qt::Key_2, Qt::Key_3, Qt::Key_4, Qt::Key_5, Qt::Key_6, Qt::Key_7, Qt::Key_8, Qt::Key_9, Qt::Key_0,
						Qt::Key_A, Qt::Key_B, Qt::Key_C, Qt::Key_D, Qt::Key_E, Qt::Key_F};

class QAction;
class QSettings;
class QLabel;
class QStatusBar;
class SettingDialog;

class Action
{
public:
	typedef enum
	{
		ActionNull, ActionCopy, ActionMove, ActionSkip, ActionLast,
	} ActionType;

	Action(ActionType t = ActionNull, const QString &p = QString(), const QString &dest = QString());

	ActionType type() const;
	QString path() const;
	QString destination() const;

private:
	ActionType mType;
	QString mPath;
	QString mDest;
};

class PicMove : public QMainWindow
{
	Q_OBJECT

public:
	PicMove(QWidget *parent = 0);
	~PicMove();

public slots:
	bool next();
	bool undo();
	bool skip();

protected:
	void keyPressEvent(QKeyEvent *);

private:
	QAction *undoAction;
	QSettings *settings;
	QLabel *preview;
	QString currentDirPath, currentFilePath;
	QStringList skippedPath;
	QStatusBar *statusBar;
	QLabel *nameLabels[MAX_DEST_COUNT];

	QStack<Action> actionStack;

	void setupMenu();
	void setupUI();

private slots:
	void openDirectory();
	void editDestinationDirectory();

	bool copyFile(QString, QString, bool overwrite = false, bool move = false);

	void loadSettings();
	void saveSettings();

	void about();
};

#endif // PICMOVE_H
